package com.chenl.interview.service;

import com.chenl.interview.model.entity.QuestionBankQuestion;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author chenl
* @description 针对表【question_bank_question(题库题目)】的数据库操作Service
* @createDate 2024-12-29 15:33:22
*/
public interface QuestionBankQuestionService extends IService<QuestionBankQuestion> {

    /**
     * 新增题库题目关联
     * @param questionId
     * @param questionBankId
     * @return
     */
    Boolean addQBQRelevance(Long questionId, Long questionBankId);

    /**
     * 批量向题库新增题目
     * @param questionIdList
     * @param questionBankId
     */
    @Transactional(rollbackFor = Exception.class)
    void batchAddQuestionsToBank(List<Long> questionIdList, Long questionBankId);

    @Transactional(rollbackFor = Exception.class)
    void batchAddQuestionsToBankInner(List<QuestionBankQuestion> questionBankQuestions);

    /**
     * 删除题目题库关联
     * @param questionId
     * @param questionBankId
     * @return
     */
    Boolean deleteQBQRelevance(Long questionId, Long questionBankId);
}
